home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
t2win-32
/
_windows.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1998-07-13
|
25KB
|
637 lines
VERSION 5.00
Begin VB.Form frmWindows
BorderStyle = 4 'Fixed ToolWindow
Caption = "Windows 95/NT 4.0x"
ClientHeight = 4845
ClientLeft = 1890
ClientTop = 3270
ClientWidth = 10815
MaxButton = 0 'False
MDIChild = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 4845
ScaleWidth = 10815
ShowInTaskbar = 0 'False
Begin VB.Frame Frame1
Height = 570
Left = 0
TabIndex = 1
Top = -90
Width = 10815
Begin VB.CommandButton cmdNP
Caption = ">"
Height = 285
Index = 1
Left = 10440
TabIndex = 6
Top = 195
Width = 285
End
Begin VB.CommandButton cmdNP
Caption = "<"
Height = 285
Index = 0
Left = 9540
TabIndex = 5
Top = 195
Width = 285
End
Begin VB.CommandButton Command1
Caption = "&Go"
Default = -1 'True
Height = 285
Left = 9900
TabIndex = 4
Top = 195
Width = 465
End
Begin VB.ComboBox cmb_Function
Height = 315
Left = 1365
TabIndex = 2
Top = 180
Width = 8085
End
Begin VB.Label Label2
Caption = "&Select a function"
Height = 255
Left = 90
TabIndex = 3
Top = 210
Width = 1275
End
End
Begin VB.TextBox txt_Result
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 4125
Left = 120
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 600
Width = 10635
End
Attribute VB_Name = "frmWindows"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Const Iteration = 250
Dim IsLoaded As Integer
Dim TimerStartOk As Integer
Dim TimerCloseOk As Integer
Dim TimerHandle As Integer
Dim TimerValue As Long
Private Sub cmdNP_Click(Index As Integer)
Call sub_NextPrev(cmb_Function, Index)
End Sub
Private Sub cmb_Function_Click()
If (IsLoaded = False) Then Exit Sub
Call cDisableFI(mdiT2W.Picture1)
txt_Result = ""
DoEvents
Select Case cmb_Function.ListIndex
Case 0
Call TestMultitasksKeys(True)
Case 1
Call TestMultitasksKeys(False)
Case 2
Call TestLockKeyboard
Case 3
Call TestLockMouse
Case 4
Call TestModule
Case 5
Call TestProcess
Case 6
Call TestThread
Case 7
Call TestWalkThruWindows
Case 8
Call TestTrayBar
Case 9
Call TestOSValue
Case 10
Call TestIsKeyOn
Case 11
Call TestSetKeyState
Case 12
Call TestTrashFile
Case 13
Call TestGetShortPathName
Case 14
Call TestRunFile
End Select
DoEvents
Call cEnableFI(mdiT2W.Picture1)
End Sub
Private Sub Form_Activate()
mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
End Sub
Private Sub Form_Load()
IsLoaded = False
Show
Call sub_Load_Combo(cmb_Function, T2WDirInst + "_windows.t2w")
IsLoaded = True
End Sub
Private Sub Command1_Click()
Call cmb_Function_Click
End Sub
Private Sub TestMultitasksKeys(status As Integer)
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
strResult = ""
strDisplay = ""
If (status = True) Then
Call cMultitasksKeys(True)
strDisplay = strDisplay & "MultitasksKeys" & vbCrLf & vbCrLf
strDisplay = strDisplay & " are now Disabled" & vbCrLf & vbCrLf
strDisplay = strDisplay & " Try CTRL+ALT+DEL or ALT+TAB or CTRL+ESC" & vbCrLf
Else
Call cMultitasksKeys(False)
strDisplay = strDisplay & "MultitasksKeys" & vbCrLf & vbCrLf
strDisplay = strDisplay & " are now Enabled" & vbCrLf & vbCrLf
strDisplay = strDisplay & " Try CTRL+ALT+DEL or ALT+TAB or CTRL+ESC" & vbCrLf
End If
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
'Call cMultitasksKeys(Status)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestLockKeyboard()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
strResult = ""
strDisplay = ""
intResult = cLockKeyboard(True, &H70)
If (intResult = True) Then
strDisplay = strDisplay & "Lock keyboard for 7 seconds (special unlock key = ALT+CTRL+SHIFT+F1)" & vbCrLf & vbCrLf
For i = 1 To 7
DoEvents
txt_Result = strDisplay
intResult = cSleep(1000)
strDisplay = strDisplay & "elapsed time : " & i & " second" & IIf(i = 1, "", "s") & vbCrLf
Next i
strDisplay = strDisplay & vbCrLf
strDisplay = strDisplay & "Start unlock keyboard" & vbCrLf
intResult = cLockKeyboard(False, 0)
If (intResult = True) Then
strDisplay = strDisplay & "Keyboard unlocked" & vbCrLf & vbCrLf
Else
strDisplay = strDisplay & "Can't unlock keyboard (cross your fingers)" & vbCrLf & vbCrLf
End If
Else
strDisplay = strDisplay & "Can't lock keyboard" & vbCrLf & vbCrLf
End If
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
'Call cLockKeyboard(True,0)
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestLockMouse()
Dim intResult As Integer
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
strResult = ""
strDisplay = ""
intResult = cLockMouse(True, LOCK_MOUSE_ALL_CLICK)
If (intResult = True) Then
strDisplay = strDisplay & "Lock mouse (ALL CLICK) for 4 seconds" & vbCrLf & vbCrLf
For i = 1 To 4
DoEvents
txt_Result = strDisplay
intResult = cSleep(1000)
strDisplay = strDisplay & "elapsed time : " & i & " second" & IIf(i = 1, "", "s") & vbCrLf
Next i
strDisplay = strDisplay & vbCrLf
strDisplay = strDisplay & "Start unlock mouse" & vbCrLf
intResult = cLockMouse(False, 0)
If (intResult = True) Then
strDisplay = strDisplay & "Mouse unlocked" & vbCrLf & vbCrLf
Else
strDisplay = strDisplay & "Can't unlock mouse (cross your fingers)" & vbCrLf & vbCrLf
End If
Else
strDisplay = strDisplay & "Can't lock mouse" & vbCrLf & vbCrLf
End If
intResult = cLockMouse(True, LOCK_MOUSE_RCLICK)
If (intResult = True) Then
strDisplay = strDisplay & "Lock mouse (RIGHT CLICK) for 4 seconds" & vbCrLf & vbCrLf
For i = 1 To 4
DoEvents
txt_Result = strDisplay
intResult = cSleep(1000)
strDisplay = strDisplay & "elapsed time : " & i & " second" & IIf(i = 1, "", "s") & vbCrLf
Next i
strDisplay = strDisplay & vbCrLf
strDisplay = strDisplay & "Start unlock mouse" & vbCrLf
intResult = cLockMouse(False, 0)
If (intResult = True) Then
strDisplay = strDisplay & "Mouse unlocked" & vbCrLf & vbCrLf
Else
strDisplay = strDisplay & "Can't unlock mouse (cros